<?php 
use App\Models\Selection as Selection;
use App\Http\Tools as Tools;

if(!isset($_SESSION)){
    session_start();
}
?>
<!--    继承layouts/std_master.php模板  -->
@extends('layouts.std_master')

<!-- 重写内容  -->
@section('content')

<div class="col-lg-3"></div>
<div class="col-lg-6">
<h1 align="center">项目明细</h1>
<div class="alert alert-info">
    
项目运行状态: {{Tools::getState($data->type)}}
</div>
	<form action="../std/apply" name="form">
		当前操作 ：
			<input type="hidden" name="pid" value="{{$data->pid}}" >
			<input type="hidden" name="sid" value="{{$_SESSION['sid']}}" >
			<?php  $selected=Selection::where('sid','=',$_SESSION['sid'])->first();  ?>
			@if(empty($selected))
           
            <!--<span class="label label-warning" >申请项目</span></div>-->
				<input type="submit" name="submit"  value="申请项目" />
                
			@elseif($data->type==1)
            <span class="label label-warning">等待通过</span></a>   
				<!--<input type="submit" name="submit" disabled value="等待通过" />-->
			@elseif($data->type==2)
				<a href="/std/start_entry/0">
                <span class="label label-warning">提交开题报告</span></a>
					<!--<input type="button" value="提交开题报告" /></a>-->
			@elseif($data->type==3)
				<a href="/std/start_entry/0">
                <span class="label label-warning">等待审核</span></a>
					<!--<input type="button" value="等待审核" /></a>-->
			@elseif($data->type==4)
				<a href="/std/mid_entry/1">
                <span class="label label-warning">提交中期检查表</span></a>
					<!--<input type="button" value="提交中期检查表" /></a>-->
			@elseif($data->type==5)
				<a href="/std/mid_entry/1">
					<span class="label label-default">暂无操作</span></a>
			@elseif($data->type==6)
				<a href="/std/final_entry/2">
					<span class="label label-warning">提交结题报告</span></a>
			@elseif($data->type==7)
				<a href="/std/final_entry/2">
					<span class="label label-default">暂无操作</span></a>
			@elseif($data->type==8)
				<a href="/std/result_entry">
                <span class="label label-warning">提交成果跟踪表</span></a>
					<!--<input type="button" value="提交成果跟踪" /></a>-->
			@elseif($data->type==9)
				<a href="/std/result_entry">
  
					<input type="button"  value="暂无操作" /></a>
			@elseif($data->type==10)
				<a href="/std/panels_entry">
                <span class="label label-warning">提交展板</span></a>
					<!--<input type="button" value="提交展板" /></a>-->
			@elseif($data->type==11)
				<a href="/std/panels_entry">
                
					<span class="label label-default">暂无操作</span></a>
			@elseif($data->type==12)
				<a href="#">
                    <span class="label label-default">已完成所有操作</span></a>
					<!--<input type="button" disabled value="已完成" /></a>-->

			@endif
		</form>
		<br>
<div class="main-box-body clearfix">
<div class="table-responsive">
<table class="table table-striped table-hover"  >
<thead>
	<tr>
		<td >项目申报人</td>
		<td>{{$data->teacher->name or ''}}</td>
	</tr>
	<tr>
		<td>项目组人员</td>
		<td>
			@foreach($data->selection as $select)
				{{$select->student->name}},
			@endforeach
		</td>
	</tr>
	<tr>
		<td>项目指导老师</td>
		<td>{{$data->teacher->name or ''}}</td>
	</tr>
	<tr>
		<td>项目名称</td>
		<td>{{$data->pname}}</td>
	</tr>
	<tr>
		<td>资助类别</td>
		<td>
			{{Tools::getSupportType($data->type) }}
		</td>
	</tr>
	<tr>
		<td>项目经费</td>
		<td>{{$data->fees}}</td>
	</tr>
	<tr>
		<td>项目来源</td>
		<td>{{$data->source}}</td>
	</tr>
	<tr>
		<td>项目起始时间</td>
		<td>{{$data->start}}</td>
	</tr>
	<tr>
		<td>项目完成时间</td>
		<td>{{$data->end}}</td>
	</tr>
	<tr>
		<td>指导教师是否确认</td>
		<td>{{$data->editable==1?'未确认':'已确认'}}</td>
	</tr>
	<tr>
		<td>项目详细内容</td>
		<td>{{$data->details}}</td>
	</tr>
</table>

<br>
</div>


@endsection